#include <iostream>
#include <vector>
#include <iomanip>

using namespace std;

// 将分数转换为对应的绩点
double getGPA(int score) {
    if (score >= 90) return 4.0;
    else if (score >= 85) return 3.7;
    else if (score >= 82) return 3.3;
    else if (score >= 78) return 3.0;
    else if (score >= 75) return 2.7;
    else if (score >= 72) return 2.3;
    else if (score >= 68) return 2.0;
    else if (score >= 64) return 1.5;
    else if (score >= 60) return 1.0;
    else return 0.0;
}

int main() {
    int n;
    cin >> n;

    vector<int> credits(n);
    vector<int> scores(n);

    // 输入学分
    for (int i = 0; i < n; ++i) {
        cin >> credits[i];
    }

    // 输入成绩
    for (int i = 0; i < n; ++i) {
        cin >> scores[i];
    }

    double totalGpaPoints = 0.0;
    int totalCredits = 0;

    // 计算每门课的绩点 × 学分，并累加
    for (int i = 0; i < n; ++i) {
        double gpa = getGPA(scores[i]);
        totalGpaPoints += gpa * credits[i];
        totalCredits += credits[i];
    }

    // 计算 GPA 总评
    double finalGPA = totalGpaPoints / totalCredits;

    // 输出保留两位小数
    cout << fixed << setprecision(2) << finalGPA << endl;

    return 0;
}